/*
 * Copyright (c) 2024 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#include <device_tree/interface/Chip.h>

MC_MODULE_REFLECT(
    device_tree, dev::gen::Chip,
    (Address)(OffsetWidth)(AddrWidth)(WriteTmout)(ReadTmout)(RwBlockSize)(WriteInterval)(ReadInterval),
    (WriteRetryTimes)(ReadRetryTimes)((BlockIORead, "BlockIORead"))((BlockIOWrite, "BlockIOWrite"))(
        (BlockIOWriteRead, "BlockIOWriteRead"))((BlockIOComboWriteRead, "BlockIOComboWriteRead"))(
        (BitIORead, "BitIORead"))((BitIOWrite, "BitIOWrite")))

namespace dev::gen {

std::vector<uint8_t> Chip::BitIORead(uint32_t offset, uint8_t length, uint32_t mask) {
    MC_THROW(mc::not_implemented_exception, "BitIORead not implemented");
};
void Chip::BitIOWrite(uint32_t offset, uint8_t length, uint32_t mask,
                      const std::vector<uint8_t>& buffer) {
    MC_THROW(mc::not_implemented_exception, "BitIOWrite not implemented");
};
std::vector<uint8_t> Chip::BlockIORead(uint32_t offset, uint32_t length) {
    MC_THROW(mc::not_implemented_exception, "BlockIORead not implemented");
};
void Chip::BlockIOWrite(uint32_t offset, const std::vector<uint8_t>& buffer) {
    MC_THROW(mc::not_implemented_exception, "BlockIOWrite not implemented");
};
std::vector<uint8_t> Chip::BlockIOWriteRead(const std::vector<uint8_t>& indata,
                                            uint32_t                    read_length) {
    MC_THROW(mc::not_implemented_exception, "BlockIOWriteRead not implemented");
};
std::vector<uint8_t> Chip::BlockIOComboWriteRead(uint32_t                    write_offset,
                                                 const std::vector<uint8_t>& write_buffer,
                                                 uint32_t read_offset, uint32_t read_length) {
    MC_THROW(mc::not_implemented_exception, "BlockIOComboWriteRead not implemented");
};
} // namespace dev::gen
